/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package org.cip.esymons.tramite.bc;

import java.util.List;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.naming.Context;
import javax.naming.InitialContext;
import javax.naming.NamingException;
import org.cip.esymons.general.be.Solicitante;
import org.cip.esymons.tramite.be.Documento;

/**
 *
 * @author Freddy Infantes
 */
public class DocumentoDelegate {
    private DocumentoFacadeLocal local;

     public void create(Documento documento)
     {
        local.create(documento);
     }

    public void edit(Documento documento)
    {
        local.edit(documento);
    }

    public void remove(Documento documento)
    {
        local.remove(documento);
    }

    public Documento find(Object id)
    {
        return local.find(id);
    }

     public List<Documento> findAll()
     {
        return local.findAll();
     }

     public List<Documento> lisatarXTransaccion(Object id){
         return local.listarXTransaccion(id);
     }
     
    public DocumentoDelegate() {
        local=lookupDocumentoFacade();
    }

    private DocumentoFacadeLocal lookupDocumentoFacade() {
        try {
            Context c = new InitialContext();
            return (DocumentoFacadeLocal) c.lookup("java:comp/env/DocumentoFacade");
        } catch (NamingException ne) {
            Logger.getLogger(getClass().getName()).log(Level.SEVERE, "exception caught", ne);
            throw new RuntimeException(ne);
        }
    }




}
